package com.info.auth;

import feign.auth.BasicAuthRequestInterceptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by pengshuo on 2018/1/7 11:54
 * Description:
 * Modified By:
 * Version:
 *
 * @author pengshuo
 */
@Configuration
public class AuthFeignConfiguration {

    @Value("${auth.info.username}")
    private String username;

    @Value("${auth.info.password}")
    private String password;

    @Value("${auth.info.role}")
    private String role;

    @Bean
    public BasicAuthRequestInterceptor basicAuthRequestInterceptor(){
        return new BasicAuthRequestInterceptor(username,password);
    }

}
